package com.pb.camera.more;

import com.pb.camera.R;
import com.pb.camera.constants.MyContants;
import com.pb.camera.manager.EventManager;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
import de.greenrobot.event.EventBus;

public class RecoderModleSelectActivity extends Activity {
    public boolean mRecodingModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recorder_modle);
        ((TextView) findViewById(R.id.tv_title))
                .setText(R.string.recoder_modle);
        findViewById(R.id.tv_recoding_full_time)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        mRecodingModel = MyContants.RECODING_FULL_TIME;
                        finish();
                    }
                });
        findViewById(R.id.tv_selectTime)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        mRecodingModel = MyContants.RECODING_INTERVAL;
                        Intent intent = new Intent(
                                RecoderModleSelectActivity.this,
                                TimePickActivity.class);
                        startActivity(intent);
                    }
                });
    }

    public void finishActivity(View v) {
        finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().post(new EventManager.SelectRecoderModeEvent(mRecodingModel));
    }
}
